﻿using ChestPainCenterSystem.ChestPainFirstAidInterface;
using ChestPainCenterSystem.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace ChestPainCenterSystem.Code.Bll
{
    public class ZhenLiaoLuJing
    {
         /// <summary>
        /// 新增和编辑诊疗路径
        /// </summary>
        /// <returns></returns>
        public static OperateResult Setzhenliaolujing(string oiverviewJson)
        {
            OperateResult resultInfo = new OperateResult();
            try
            {
                ThreeCenterManageSoapClient service = new ThreeCenterManageSoapClient();
                ResultHelperOfBoolean result = service.Setzhenliaolujing(oiverviewJson);
                if (result.S)
                {
                    resultInfo.Result = 1;
                    resultInfo.Body = result.M;
                }
                else
                {
                    resultInfo.Result = 0;
                    resultInfo.Body = result.M;
                }
            }
            catch (Exception ex)
            {
                resultInfo.Result = -1;
                resultInfo.Body = ex.Message;
            }
            return resultInfo;
        }

        /// <summary>
        /// 获取诊疗路径
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="name"></param>
        /// <returns></returns>
        public static OperateResult GetzhenliaolujingList(int Id ,int pageIndex, int pageSize, string name)
        {

            OperateResult resultInfo = new OperateResult();
            try
            {
                ThreeCenterManageSoapClient service = new ThreeCenterManageSoapClient();
                ResultHelperOfString result = service.GetzhenliaolujingList(Id,name, pageIndex, pageSize);
                if (result.S)
                {
                    resultInfo.Result = 1;
                    resultInfo.Body = result.D;
                }
                else
                {
                    resultInfo.Result = 0;
                    resultInfo.Body = result.M;
                }
            }
            catch (Exception ex)
            {
                resultInfo.Result = -1;
                resultInfo.Body = ex.Message;
            }
            return resultInfo;
        }
    }
}